package com.jyw.business.de.domain.dto.web;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jyw.business.de.constant.TaskStateConstant;
import com.jyw.business.de.constant.TaskTypeConstant;
import com.jyw.business.de.domain.DeTaskInfo;
import com.jyw.common.utils.DateUtils;
import com.jyw.common.utils.SecurityUtils;
import com.jyw.common.utils.bean.BeanUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@ApiModel("需求任务编辑请求实体")
public class TaskEditDto extends TaskAddDto{

    @ApiModelProperty("任务主键")
    @NotNull(message = "任务主键不能为空")
    private Long id;

    @Override
    public DeTaskInfo buildTask() {
        DeTaskInfo taskInfo = new DeTaskInfo();
        taskInfo.setId(getId());
        taskInfo.setTaskName(getTaskName());
        taskInfo.setTaskRemark(getTaskRemark());
        taskInfo.setTaskUser(getTaskUser());
        taskInfo.setReqCompleteDate(getReqCompleteDate());
        taskInfo.setUpdateTime(DateUtils.getNowDate());
        return taskInfo;
    }
}
